#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
using namespace std;
#include <string.h>
#include <vector>
#include <string>
#include <algorithm>
void task()
{
    char str[255] = "abcd12345ed125ss123058789";
    //cin >> str;
    int maxlen = 0;
    int n = strlen(str);
    int j = 0;
    int a = 0;
    vector<string> vs(1);
    for (int i = 0; i < n; i++)
    {
        if (str[i] >= (0 + '0') && str[i] <= (9 + '0'))
        {
            vs[j] += str[i];
            a++;
        }
        else
        {
            maxlen = max(maxlen, a);
            if (a != 0)
                vs.resize(1 + (++j));
            a = 0;
        }
    }

    for (auto& s : vs)
    {
        if (s.size() == maxlen)
        {
            cout << s;
        }
    }
}
//int main() {
//    task();
//    return 0;
//}

int surplus(int arr[], int i, int j, int m)
{
    int a = 0;
    int num = 0;
    for (int n = 0; n < 6; n++)
    {
        if (n != i && n != j && n != m)
        {

            if (num < 2)
            {
                a += arr[n];
                num++;
            }
            else
            {
                if (a > arr[n] && num == 2)
                {
                    return 1;
                }
                else
                {
                    return 0;
                }
            }
        }
    }
    return 0;
}


int main() {
    int n;
    int arr[6];
    cin >> n;
    while (n--)
    {
        for (int i = 0; i < 6; i++)
        {
            cin >> arr[i];
        }
        int t = 0;
        int k = 0;
        sort(arr, arr + 6);
        for (int i = 0; i < 6; i++)
        {
            for (int j = i + 1; j < 6; j++)
            {
                for (int m = j + 1; m < 6; m++)
                {
                    if (arr[i] + arr[j] > arr[m])
                    {
                        t = surplus(arr, i, j, m);
                        if (t == 1)
                            k = 1;

                    }
                }
            }
        }

        if (k == 1)
        {
            cout << "Yes" << endl;
        }
        else
        {
            cout << "No" << endl;
        }

    }


    return 0;
}